﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Windows8Accelerator.Core.Xaml.Helpers
{
    public abstract class ShareContractHelperBase
    {
        private static ShareContractHelperBase _Instance;
        public static ShareContractHelperBase Instance
        {
            get
            {
                if (_Instance == null)
                    _Instance = AssemblyHelper.CreateInstanceOfAccelerator<ShareContractHelperBase>();
                return _Instance;
            }
        }

        public abstract void ShowShareUI();
        public abstract void EnableShare();

        public event EventHandler<ShareDataRequestedEventArgs> DataRequested;

        protected void OnDataRequested(ShareDataRequestedEventArgs args)
        {
            if (DataRequested != null)
                DataRequested(this, args);
            else
                args.Cancel = true;
        }
    }

    public class ShareDataRequestedEventArgs : EventArgs
    {
        public string Html { get; set; }
        public string Rtf { get; set; }
        public string Text { get; set; }
        public Uri Uri { get; set; }
        public string Title { get; set; }
        public string Description { get; set; }
        public bool Cancel { get; set; }
    }
}
